package cn.sofwin.sb;


import cn.sofwin.sb.core.annotation.BaseDao;
import cn.sofwin.sb.core.mvc.entity.IdEntity;
import cn.sofwin.sb.service.UserService;

import java.lang.reflect.Field;

public class Main {
    public static void main(String[] args) {
        /*UserService userService=new UserService();
        initAutowired(userService);
        System.out.println("userDao:"+userService.getUserDao());*/


    }

   /* public static void initAutowired(Object obj){
        Field[] fields = obj.getClass().getDeclaredFields();
        try {
            for(Field field:fields){
                BaseDao<IdEntity> mydao = field.getAnnotation(BaseDao.class);
                if(mydao != null){
                    System.out.println("发现小仙女："+field.getName());

                    //第一阶段：实现设置属性值的操作
                    field.setAccessible(true);
                   // field.set(obj,new UserDao());

                    //第二阶段：动态设置对应数据类型的对象
                    System.out.println(field.getType());
                    field.set(obj,field.getType().newInstance());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }*/
}
